package com.authority.dao;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.authority.entry.AuthUserDO;
import com.authority.query.UserQuery;

/**
 * @Description:对用户表操作DAO
 * @author limeng.g
 * @date 2015年10月20日 上午11:01:20
 * 
 */
public interface AuthUserDAO {

	AuthUserDO querySingleUserByAccount(String account);

	int updateUser(Map<String,Object> map);

	Long insertUser(AuthUserDO userDo);
	
	Integer deleteUser(AuthUserDO db);
	/**
	 * 
	 * <p>Title: checkAccount</p>
	 * <p> 功能描述:检测账户是否存在 </p>
	 * @param map
	 * @return
	 */
	Integer checkAccount(Map<String,Object> map);

	List<AuthUserDO> queryUserListForAuth(UserQuery query);
	List<AuthUserDO> queryUserByParam(Map<String,Object> map);
	
	int queryUserListCountForAuth(UserQuery query);

	String queryUserNameById(Long id);
	
	Integer queryCountNum(UserQuery query);
	
	List<AuthUserDO> queryUserPage(UserQuery query);
	
	int updateUserLastLoginTime(Long id);
	
	AuthUserDO checkAccountAndPassword(@Param("account")String account,@Param("password")String password);

	AuthUserDO queryUserById(Long userId);

	void updateUserPassWord(AuthUserDO db);
	void updateUserPassWordById(AuthUserDO db);
	void updateUserPassWordByAccount(AuthUserDO db);
	int updateUserRole(AuthUserDO db);
	int updateUserLatsLoginIp(Map<String,Object> map);
	
	int updateUserByOrganId(Map<String,Object> map);
}
